////
//// Created by ziya on 2021/9/3.
////
//
///**
// * 该文件中多个线程共享同一个线程函数
// * test_3 做了拆分
// */
//
//#include "../common.h"
//
//#include <pthread.h>
//
//int test_2_i = 0;
//
//pthread_mutex_t test_2_lock;
//
//void* thread_fun(void* arg) {
//    pthread_mutex_lock(&test_2_lock);
//
//    for (int j = 0; j < 10000; ++j) {
//        test_2_i++;
//    }
//
//    pthread_mutex_unlock(&test_2_lock);
//
//    return 0;
//}
//
////int main() {
////    INFO_PRINT("here\n");
////
////    pthread_t tid[2];
////
////    // 初始化锁
////    pthread_mutex_init(&test_2_lock, NULL);
////
////    pthread_create(&tid[0], NULL, thread_fun, NULL);
////    pthread_create(&tid[1], NULL, thread_fun, NULL);
////
////    pthread_join(tid[0], NULL);
////    pthread_join(tid[1], NULL);
////
////    // 销毁锁
////    pthread_mutex_destroy(&test_2_lock);
////
////    INFO_PRINT("i = %d\n", test_2_i);
////
////    return 0;
////}